const studentDao = require('../dao/studentDao');
module.exports.find = async function(searchObj,page){
    return await studentDao.find(searchObj,page);
}
module.exports.findByClassName = async function(className,page){
    return await studentDao.findByClassName(className,page);
}
module.exports.findById = async function(id){
    try{
        return await studentDao.findById(id);
    }catch(e){
        return {};
    }
}
module.exports.insert = async function(student){
    return await studentDao.insert(student);
}
module.exports.update = async function(id,student){
    try{
        return await studentDao.update(id,student);
    }catch(e){
        console.log('e',e)
        return {}
    }
}
module.exports.delete = async function(id){
    try{
        return await studentDao.delete(id);
    }catch(e){
        return {}
    }
}